<?php 
$dich_vu = $this->requestAction('cms_pages/get_dich_vu');
?>
<div id="imgShow">
	<ul id="imageShow">
		<li class="current"><img src="<?php echo $this->webroot;?>img/frontend/taulua.jpg"/></li>
		<li><img src="<?php echo $this->webroot;?>img/frontend/maybay.png"/></li>		
	</ul>
	<script type="text/javascript">
	$(document).ready(function() {
		setInterval('imageRotator()', 2000);
	});

	function imageRotator() {
		var curImg = $('#imageShow li.current');
		var nextImg = curImg.next();

		if (nextImg.length == 0) {
			nextImg = $('#imageShow li:first');
		};

		curImg.removeClass('current').addClass('previous');
		nextImg.css({opacity:0}).addClass('current').animate({opacity:1}, 1000, function() {
			curImg.removeClass('previous');
		});
	};   
	</script>
</div>
<div id="intro">
	<?php
	if($dich_vu && count($dich_vu)>0) {
		$icon = 0;
		foreach ($dich_vu as $k=>$v) {
			$icon ++;			
			$id = isset($this->params['pass'][0])?intval($this->params['pass'][0]):0;
			//active item
			if($id==$v['CmsPage']['id']) {
				$ac = 'active ';
			} else {
				$ac = '';
			}
			//first item
			if($icon==1) {
				$f = 'first ';
			} elseif($icon==count($dich_vu)) {
				//last item			 
				$f = 'last ';
			} else {
				$f = '';
			}	
			echo '<div class="'.$ac.'item '.$f.'icon_'.$icon.'">
					<p class="header"><a href="'.$frontend_url.'cms_pages/view/'.$v['CmsPage']['code'].'#view_cms_page">'.$v['CmsPage']['title_'.$site_lang].'</a></p>
					<p>'.$v['CmsPage']['desc_'.$site_lang].'</p>
				</div>';
		}
	} else {
		echo $this->element('data_not_found');
	}	
	?>	
</div>